curve sketching using the first and second derivatives